Fix `cargo doc --open` on Windows
authorPatrick Reisert <kpreisert@gmail.com>
Fri, 10 Jun 2016 13:07:55 +0000 (15:07 +0200)
committerGitHub <noreply@github.com>
Fri, 10 Jun 2016 13:07:55 +0000 (15:07 +0200)
This fixes #2446. Note that I have not built cargo with this change, but I have tested the functionality in isolation (on Windows 10).

As to the issue itself, I don't know why the previous version didn't work, but `start` is redundant when `cmd /C` is used.

src/cargo/ops/cargo_doc.rs

index 5b271567eee102ea01592a3d366d1a14a41dbaaa..43a6621d750fac7e722a620e5bc8f122525c9454 100644 (file)
@@ -99,9 +99,9 @@ fn open_docs(path: &Path) -> Result<&'static str, Vec<&'static str>> {
 
 #[cfg(target_os = "windows")]
 fn open_docs(path: &Path) -> Result<&'static str, Vec<&'static str>> {
-    match Command::new("cmd").arg("/C").arg("start").arg("").arg(path).status() {
-        Ok(_) => return Ok("cmd /C start"),
-        Err(_) => return Err(vec!["cmd /C start"])
+    match Command::new("cmd").arg("/C").arg(path).status() {
+        Ok(_) => return Ok("cmd /C"),
+        Err(_) => return Err(vec!["cmd /C"])
     };
 }